package cn.fanqinghong.ymcc.feignClient;

import cn.fanqinghong.ymcc.domain.Blacklist;
import cn.fanqinghong.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * FAN
 * 2022/7/17  15:51
 */
@Component
public class BlacklistFallbackFactory implements FallbackFactory {
    @Override
    public Object create(Throwable throwable) {
        return new BlacklistFeignClient() {
            @Override
            public JSONResult getPhone(String phone) {
                return JSONResult.error("服务到达不了","5000");
            }
        };
    }
}

